package com.ruoyi.web.controller.pc.anon;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.blogs.domain.BsChannel;
import com.ruoyi.blogs.domain.BsDirection;
import com.ruoyi.blogs.domain.BsGroup;
import com.ruoyi.blogs.domain.BsTag;
import com.ruoyi.blogs.service.IBsChannelService;
import com.ruoyi.blogs.service.IBsDirectionService;
import com.ruoyi.blogs.service.IBsGroupService;
import com.ruoyi.blogs.service.IBsTagService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "字典")
@RestController
@RequestMapping("/anon/dict")
public class AnonDictController extends BaseController {

    @Autowired
    private IBsGroupService bsGroupService;

    @Autowired
    private IBsDirectionService bsDirectionService;

    @Autowired
    private IBsTagService bsTagService;

    @Autowired
    private IBsChannelService bsChannelService;

    /**
     * 查询分类列表
     */
    @ApiOperation("获取分类全部列表")
    @GetMapping("/group/list")
    public R<List<BsGroup>> groupList(BsGroup bsGroup) {
        bsGroup.setVisible(0);
        return R.ok(bsGroupService.selectBsGroupList(bsGroup));
    }

    /**
     * 查询方向列表
     */
    @ApiOperation("获取方向全部列表")
    @GetMapping("/direction/list")
    public R<List<BsDirection>> directionList(BsDirection bsDirection) {
        bsDirection.setVisible(0);
        return R.ok(bsDirectionService.selectBsDirectionList(bsDirection));
    }

    /**
     * 查询标签列表
     */
    @ApiOperation("获取标签全部列表")
    @GetMapping("/tag/list")
    public R<List<BsTag>> tagList(BsTag bsTag) {
        bsTag.setVisible(0);
        return R.ok(bsTagService.selectBsTagList(bsTag));
    }

    /**
     * 查询频道列表
     */
    @ApiOperation("获取频道全部列表")
    @GetMapping("/channel/list")
    public R<List<BsChannel>> channelList(BsChannel bsChannel) {
        bsChannel.setVisible(0);
        return R.ok(bsChannelService.selectBsChannelList(bsChannel));
    }
}
